<template>
    <div>
        我是子组件
    </div>
</template>

<script setup>
import {
    onActivated,
    onDeactivated
} from 'vue'

onActivated(() => {
    console.log('onActivated');
})

onDeactivated(() => {
    console.log('onDeactivated');
})
</script>
<style scoped></style>